/**
 * Project: lionbule-other
 * 
 * File Created at 2012-4-6
 * $Id$
 * 
 * Copyright 1999-2100 Alibaba.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package com.verfy.parser;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * TestRegex.
 * 
 * @author LionBule 2012-4-6 下午1:51:33
 */
public class TestRegex {

    /**
     * @param args
     */
    public static void main(String[] args) {
        //\d+(?:.\d+)?
        Pattern p = Pattern.compile("\\d+(?:\\.\\d+)?");
        Matcher m = p.matcher("(1.0,40)");
        while (m.find()) {
            System.out.println(m.group());
        }

        Pattern great = Pattern.compile("\\(\\d+(?:\\.\\d+)?,∞\\)");
        Matcher mg = great.matcher("(1.0,∞)");
        System.out.println(mg.matches());
        
        Pattern L_OR_G         = Pattern
                .compile("\\(∞,\\d+(?:\\.\\d+)?\\)\\|\\|\\(\\d+(?:\\.\\d+)?,∞\\)");
        
        Matcher mlorg = L_OR_G.matcher("(∞,1)||(5,∞)");
        System.out.println(mlorg.matches());
    }

}
